def isIsomorphic(s, t):
    hash_map = {}
    for i in enumerate(s):
        if i[1] not in hash_map:
            hash_map[i[1]] = t[i[0]]
        else:
            if t[i[0]] == hash_map[i[1]]:
                continue
            else:
                return False
    hash_map = {}
    for i in enumerate(t):
        if i[1] not in hash_map:
            hash_map[i[1]] = s[i[0]]
        else:
            if s[i[0]] == hash_map[i[1]]:
                continue
            else:
                return False
    return True


print(isIsomorphic("ab", "aa"))